package my.state.headfirst.low;

public class GumballMachineTestDrive {
    public static void main(String[] args) {
        //糖果机
        GunballMachine gunballMachine = new GunballMachine(2);
        System.out.println(gunballMachine);
        gunballMachine.insertQuarter();
        gunballMachine.turnCrank();
        System.out.println(gunballMachine);

        gunballMachine.insertQuarter();
        gunballMachine.ejectQuarter();
        gunballMachine.turnCrank();

        System.out.println(gunballMachine);

        gunballMachine.insertQuarter();
        gunballMachine.turnCrank();
        gunballMachine.insertQuarter();
        gunballMachine.turnCrank();
        gunballMachine.ejectQuarter();

        System.out.println(gunballMachine);

        gunballMachine.insertQuarter();
        gunballMachine.insertQuarter();
        gunballMachine.turnCrank();
        gunballMachine.insertQuarter();
        gunballMachine.turnCrank();
        gunballMachine.insertQuarter();
        gunballMachine.turnCrank();

        System.out.println(gunballMachine);
    }
}
